#ifndef __FINITEAUTOMATON__

#define __FINITEAUTOMATON__ 

#include"namestorage.h"
#include<string>
#include<set>
#include<istream>

class FA {

  protected:
  
  static NameStorage names;  
  static NameStorage initNames();  
  static std::pair<std::pair<unsigned, char>, unsigned> extractRuleFromStream(std::istream &);  
  static std::string extractAlNum(std::string const &);  
  static std::set<unsigned> setUnion(std::set<unsigned> const &, std::set<unsigned> const &);
  static std::set<unsigned> setIntersection(std::set<unsigned> const &, std::set<unsigned> const &);
  static std::set<unsigned> setDifference(std::set<unsigned> const &, std::set<unsigned> const &);
  static std::string concatName(std::set<unsigned> const &);
  
  public:
  
  FA() {}
  virtual ~FA() {}
  virtual std::set<unsigned> feedTerminal(std::set<unsigned> const &, char) const = 0;
  virtual std::set<unsigned> feedString(std::set<unsigned> const &, std::string const &) const = 0; 
 
};


class CompareSet {
	public:
		
	bool operator()(std::set<unsigned> const &, std::set<unsigned> const &);
};


#endif
